import 'package:taonile/generated/json/base/json_field.dart';
import 'package:taonile/generated/json/getcash_record_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class GetcashRecordEntity {
  late int code = 0;
  late String msg;
  late GetcashRecordData data = GetcashRecordData();

  GetcashRecordEntity();

  factory GetcashRecordEntity.fromJson(Map<String, dynamic> json) =>
      $GetcashRecordEntityFromJson(json);

  Map<String, dynamic> toJson() => $GetcashRecordEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class GetcashRecordData {
  @JSONField(name: "current_page")
  late String currentPage;
  late List<GetcashRecordDataData> data = [];

  GetcashRecordData();

  factory GetcashRecordData.fromJson(Map<String, dynamic> json) => $GetcashRecordDataFromJson(json);

  Map<String, dynamic> toJson() => $GetcashRecordDataToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class GetcashRecordDataData {
  late String id;
  @JSONField(name: "user_id")
  late String userId;
  @JSONField(name: "order_sn")
  late String orderSn;
  late String money;
  late String handingfee;
  @JSONField(name: "received_money")
  late String receivedMoney;
  @JSONField(name: "account_id")
  late String accountId;
  @JSONField(name: "account_text")
  late GetcashRecordDataDataAccountText accountText;
  late String memo;
  late String status;
  late String transfertime;
  late String reason;
  @JSONField(name: "created_at")
  late String createdAt;
  @JSONField(name: "updated_at")
  late String updatedAt;

  GetcashRecordDataData();

  factory GetcashRecordDataData.fromJson(Map<String, dynamic> json) =>
      $GetcashRecordDataDataFromJson(json);

  Map<String, dynamic> toJson() => $GetcashRecordDataDataToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class GetcashRecordDataDataAccountText {
  late String id;
  @JSONField(name: "user_id")
  late String userId;
  late String type;
  @JSONField(name: "real_name")
  late String realName;
  @JSONField(name: "id_number")
  late String idNumber;
  @JSONField(name: "bank_number")
  late String bankNumber;
  @JSONField(name: "bank_name")
  late String bankName;
  late String province;
  late String city;
  late String district;
  @JSONField(name: "bank_branch")
  late String bankBranch;
  late String mobile;
  @JSONField(name: "created_at")
  late String createdAt;
  @JSONField(name: "updated_at")
  late String updatedAt;

  GetcashRecordDataDataAccountText();

  factory GetcashRecordDataDataAccountText.fromJson(Map<String, dynamic> json) =>
      $GetcashRecordDataDataAccountTextFromJson(json);

  Map<String, dynamic> toJson() => $GetcashRecordDataDataAccountTextToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
